home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Shell ƒ / timing.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  638 b   |  32 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. long        oldTicks;
  4.  
  5. pascal void StartTiming(void)
  6. {
  7.     oldTicks=TickCount();
  8. }
  9.  
  10. pascal void TimeCorrection(short tickCount)
  11. {
  12.     long        newTicks;
  13.     
  14.     newTicks=TickCount();
  15.     while (newTicks-oldTicks<tickCount)
  16.         Delay(1L, &newTicks);
  17. }
  18.  
  19. pascal void ScrollTheRect(Rect *r, short dh, short dv, RgnHandle unused)
  20. {
  21.     Rect            theDestRect;
  22.     GrafPtr            thePort;
  23.     RgnHandle        temprgn;
  24.     
  25.     SetRect(&theDestRect, (*r).left+dh, (*r).top+dv, (*r).right+dh, (*r).bottom+dv);
  26.     temprgn=NewRgn();
  27.     RectRgn(temprgn, r);
  28.     GetPort(&thePort);
  29.     CopyBits(&(thePort->portBits), &(thePort->portBits), r, &theDestRect, 0, temprgn);
  30.     DisposeRgn(temprgn);
  31. }
  32.